package com.lxy.bean;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName: Menu 
 * @Description: 菜单类
 * @author Johnathan.Zhang
 * @date 2015-7-15 下午10:26:07 
 *
 */
public class Menu implements Comparable<Menu>{
	private Integer id;

    private String text;
    
    private String iconCls;
    
    private String url;
    
    private String type;

    private Integer order;
    
    private String state;
    
    private int parentId;
    
    private boolean checked;
    
    private List<Menu> children = new ArrayList<>();
    
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getIconCls() {
		return iconCls;
	}

	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Integer getOrder() {
		return order;
	}

	public void setOrder(Integer order) {
		this.order = order;
	}


	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	
	public int getParentId() {
		return parentId;
	}

	public void setParentId(int parentId) {
		this.parentId = parentId;
	}

	public List<Menu> getChildren() {
		return children;
	}

	public void setChildren(List<Menu> children) {
		this.children = children;
	}
	
	public boolean isChecked() {
		return checked;
	}

	public void setChecked(boolean checked) {
		this.checked = checked;
	}

	public Menu(Integer id, String text, String iconCls,
			String url, String type, Integer order, String state, int parentId) {
		super();
		this.id = id;
		this.text = text;
		this.iconCls = iconCls;
		this.url = url;
		this.type = type;
		this.order = order;
		this.state = state;
		this.parentId = parentId;
	}
	

	@Override
	public String toString() {
		return "Menu [id=" + id + ", text=" + text + ", iconCls=" + iconCls
				+ ", url=" + url + ", type=" + type + ", order=" + order
				+ ", state=" + state + ", parentId=" + parentId + ", children="
				+ children + "]";
	}

	@Override
	public int compareTo(Menu o) {
		 return this.getOrder().compareTo(o.getOrder());  
	}

}
